<template>
  <div :class="{ 'new-falg': isShowNewTag($data.data.newFlag) }">
    {{ $data.data.name }}
    <!-- <div v-if="isShowNewTag($data.data.newFlag)"
         class="">New</div> -->
  </div>
</template>

<script>
// import store from '@/store'
import moment from 'moment'

export default {
  data () {
    return {}
  },
  created () {
  },
  methods: {
    isShowNewTag (dueDate) {
      if (dueDate) {
        return moment().isBefore(dueDate)
      } else {
        return false
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.new-falg:after {
  content: "New";
  background-color: red;
  color: #ffffff;
  padding: 2px 4px;
  border-radius: 12px 12px 12px 0;
  font-size: 10px;
}
</style>
